package my.ts.code.viewgroup;

import my.ts.code.R;
import my.ts.code.objects.Item;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ContentItem extends LinearLayout {

	public TextView title, content;

	public ContentItem(Context context, Item item) {
		super(context);
		LayoutInflater li = (LayoutInflater) this.getContext()
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		li.inflate(R.layout.content_item, this, true);

		title = (TextView) findViewById(R.id.title);
		if (item.getTitle() != null)
			title.setText(item.getTitle());
		else
			title.setVisibility(View.GONE);
		content = (TextView) findViewById(R.id.content);
		if (item.getContent() != null)
			content.setText(item.getContent());
		// TODO Auto-generated constructor stub
	}

}
